package cn.netshop.pojo.;

import com.alibaba.fastjson.JSONObject;

/**
 * tb_album实体类
 * 
 * @author 
 *
 */
public class TbAlbum {
	/**编号*/
	private Long id; 
	/**相册名称*/
	private String title; 
	/**相册封面*/
	private String image; 
	/**图片列表*/
	private String imageItems; 
	/**
	 * 实例化
	 */
	public TbAlbum() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public TbAlbum(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).longValue());
		}
		if (obj.get("title") instanceof String) {
			this.setTitle((String) obj.get("title"));
		}
		if (obj.get("image") instanceof String) {
			this.setImage((String) obj.get("image"));
		}
		if (obj.get("imageItems") instanceof String) {
			this.setImageItems((String) obj.get("imageItems"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getTitle() != null) {
			result.put("title",this.getTitle());
		}
		if (this.getImage() != null) {
			result.put("image",this.getImage());
		}
		if (this.getImageItems() != null) {
			result.put("imageItems",this.getImageItems());
		}
		return result;
	}
	
	
	/**
	 * 获取id
	 * 
	 * @return
	 */
	public Long getId() {
		return id;
	}

	/**
	 * 设置id
	 * 
	 * @param id
	 */
	public void setId(Long id) {
		this.id = id;
	}
	
	/**
	 * 获取title
	 * 
	 * @return
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * 设置title
	 * 
	 * @param title
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	
	/**
	 * 获取image
	 * 
	 * @return
	 */
	public String getImage() {
		return image;
	}

	/**
	 * 设置image
	 * 
	 * @param image
	 */
	public void setImage(String image) {
		this.image = image;
	}
	
	/**
	 * 获取imageItems
	 * 
	 * @return
	 */
	public String getImageItems() {
		return imageItems;
	}

	/**
	 * 设置imageItems
	 * 
	 * @param imageItems
	 */
	public void setImageItems(String imageItems) {
		this.imageItems = imageItems;
	}

	@Override
	public String toString() {
		return "TbAlbum [id=" + id + " , title=" + title + " , image=" + image + " , imageItems=" + imageItems + "  ]";
	
	}
	
	
}
